<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文档加载完之后</title>
    <script>
        window.onload = function(){
            var d1Ele = document.getElementById("d1");
            alert(d1Ele.innerText);
        };

    </script>
</head>
<body>

<div id="d1">我是div</div>

</body>
</html>